package mo.tags.greedy;

public class L334 {

    public boolean increasingTriplet(int[] nums) {
        int m1 = Integer.MAX_VALUE, m2 = Integer.MAX_VALUE;
        for (int num : nums) {
            if (m1 >= num) {
                m1 = num;
            } else if (m2 >= num) {
                m2 = num;
            } else {
                return true;
            }
        }
        return false;
    }

    public static void main(String[] args) {
        L334 test = new L334();
        System.out.println(test.increasingTriplet(new int[]{2,1,5,0,4,6}));
    }
}
